const HOST = 'http://localhost:3001'

export async function get(url: string) {
  const res = await fetch(`${HOST}${url}`)
  return res.json()
}

export const post = async (url: string, body: any) => {
  const res = await fetch(`${HOST}${url}`, {
    method: 'post',
    body: JSON.stringify(body),
  })

  return res.json()
}
